package

var MsgFlags = map[int]string {
	SUCCESS : "ok"
	ERROR : "fail"
	INVALID_PARAMS : "request parameter error"

	ERROR_EXIST_TAG : "the label name already exists"
	ERROR_NOT_EXIST_TAG : "the label does not exist"
	ERROR_NOT_EXIST_ARTICLE : "the article does not exist"

	ERROR_AUTH_CHECK_TOKEN_FAIL : "token authentication failed"
	ERROR_AUTH_CHECK_TOKEN_TIMEOUT : "token has timed out"
	ERROR_AUTH_TOKEN : "token generation failed"
	ERROR_AUTH : "token error"
}

func GetMsg(code int) string {
	msg,ok := MsgFlags[code]
	if ok {
		return msg
	}
	return MsgFlags[ERROR]
}